#ifndef CREATECHARACTER_H
#define CREATECHARACTER_H

// Libraries
#include "state.h"
#include "singleton.h"

// Forward Declarations
class PacketClass;

// Classes
class CreateCharacterState : public CState, public Singleton<CreateCharacterState>
{
	public:
		enum StateType 
		{
			STATE_MAIN,
			STATE_SEND,
		};

		enum ElementType 
		{
			ELEMENT_NAME,
			ELEMENT_CREATE,
			ELEMENT_BACK,
			ELEMENT_PORTRAITS,
		};

		bool Show();
		bool Hide();
		
		void HandleDisconnect(ENetEvent *TEvent);
		void HandlePacket(ENetEvent *TEvent);
		bool HandleKeyPress(EKEY_CODE TKey);
		void HandleGUI(EGUI_EVENT_TYPE TEventType, IGUIElement *TElement);

		void Update(u32 TDeltaTime);
		void Draw();

	private:

		void UpdateSelection(int TSelectedIndex);
		void CreateCharacter();
		void Back();
		
		// States
		int State;

		// GUI
		IGUIEditBox *EditName;
		IGUIButton *ButtonCreate, *ButtonBack, *SelectedButton;
		stringc Message;
		int SelectedIndex;

		array<int> Portraits;		
};

#endif
